package cn.otrue.patienthealthmanager.adapter;

import java.util.List;
import java.util.Map;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;
import cn.otrue.patienthealthmanager.R;

public class CommtyAdpater extends BaseAdapter {

	private List<Map<String, String>> butt;
	private LayoutInflater inflater;
	private Context context;

	public CommtyAdpater(List<Map<String, String>> butt,
			Context context ) {
		this.butt = butt;
		inflater = LayoutInflater.from(context);
		this.context = context;
	}
	@Override
	public int getCount() {
		// TODO Auto-generated method stub
		return butt.size();
	}

	@Override
	public Object getItem(int position) {
		// TODO Auto-generated method stub
		return butt.get(position);
	}

	@Override
	public long getItemId(int position) {
		// TODO Auto-generated method stub
		return position;
	}

	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
		convertView = inflater
				.inflate(R.layout.item_healthycomm, null);
		
		
		TextView tv_jiankang = (TextView) convertView
				.findViewById(R.id.tv_jiankang);
	
		Map<String, String> map = butt.get(position);
		tv_jiankang.setText(map.get("sectionName"));
		return convertView;
	}
}
